]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnails: Avoid access to undefined variables
authorXiaoguang Wang <xwang@suse.com>
Wed, 20 Sep 2017 01:05:16 +0000 (09:05 +0800)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 2 May 2018 18:04:42 +0000 (20:04 +0200)
If thumbnails haven't been created, they don't need to be destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=787871

js/ui/workspaceThumbnail.js

index c1b4bddc66754532263bc99d23230849a7a3bd17..1ecdd92ccb3027bb519a07d027fc8eadc79be858 100644 (file)
@@ -884,6 +884,9 @@ var ThumbnailsBox = new Lang.Class({
     },
 
     _destroyThumbnails() {
+        if (this._thumbnails.length == 0)
+            return;
+
         if (this._switchWorkspaceNotifyId > 0) {
             global.window_manager.disconnect(this._switchWorkspaceNotifyId);
             this._switchWorkspaceNotifyId = 0;